var $,element,layer


layui.use(['element','layer'], function() {

    //定义调用模块
    $ = layui.$, element = layui.element, layer = layui.layer;
    PendingProducts();
    CourseCheck();
    selSumTips();
    LoginTitle();
    var boo=false;
    if(boo){
        var i= "<li class='dd_div_ul_li'>"
            +"<a onclick='xadmin.add_tab('暂无','')' src='#'>暂无<span class='colred1 colred'></span></a>"
            +"</li>"
        $("#tips").append(i)
    }
})

function selSumTips(){
    $.post("/personnel/selSumTips",{},function (data) {
        if (data.data!=0) {
            $("#layui-badge").html(data.data);
        }else{
            $("#layui-badge").html(0);
        }
    });
}

function PendingProducts(){
    $.post("/SyOperationController/getStatisticalAuditStatus",{"productSate":2},function (data) {
        if (data.data) {
            var i= "<li class='dd_div_ul_li2'>"
                +"<a class='a_class' onclick=\"xadmin.add_tab('商品待审核信息','/operation/PendingProducts.html')\">商品待审核信息<span class='colred1 colred span_class'>(<span class='span_class2'>"+data.data+"</span>)</span></a>"
                +"</li>"
            $("#tips").append(i)
        }else{
            boo=true;
        }
    });
}

function CourseCheck(){
    $.ajax({
        url:"/SyteacherSelController/Secstatus",
        type:"post",
        dataType:"json",
        data:[],
        success:function(data){
            if (data.data) {
                var i= "<li class='dd_div_ul_li2'>"
                    +"<a class='a_class' onclick=\"xadmin.add_tab('课程待审核信息','/public/CourseCheck.html')\">课程待审核信息<span class='colred1 colred span_class'>(<span class='span_class2'>"+data.data+"</span>)</span></a>"
                    +"</li>"
                $("#tips").append(i);
            }else{
                boo=true;
            }
        }
    })
}
function LoginTitle(){
    $.ajax({
        url : '/Navigation/selNavigation',
        type : "post",
        dataType : "json",
        async: true,
        data : {},
        success : function(data) {
            stringify("user",data);
            var i="<img class='layui-nav-img'  src='"+data.past1+data.avatar_url+"'>"
                + "<span id='LoginTitle'>"+data.true_name+"</span>"
            $("#LogText").html(i);
        }
    })
}


